<%--
  Created by IntelliJ IDEA.
  User: w1057229265
  Date: 2021/5/18
  Time: 11:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>系统登录窗口</title>
    <link rel="stylesheet" type="text/css" href="static/login/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="static/login/css/page.css"/>
    <script type="text/javascript" src="../static/plugins/jquery-easyui-1.9.15/jquery.min.js"></script>
    <script type="text/javascript" >
        $(function () {
            $("#bn").click(function () {
                var username=$("#username").val();
                var password=$("#password").val();
                var validcode=$("#validcode").val();
                $.ajax({
                    type: "POST",
                    url: "ServletLogin?action=login1",
                    data: {username: username, password: password,validcode:validcode},
                    success: function (ret) {
                        let result = eval("("+ret+")");
                        if (result.code =="201"){
                            location.href="index.jsp"}
                        else {
                            alert(result.msg)
                        }

                    }
                })
            })
        });
        $('#password').focus(function(){
            $(this).css('border-color','red');
        });
        $('#password').blur(function(){
            alert($(this).val());
        });
    </script>

    <script type="text/javascript" src="static/login/js/public.js"></script>
</head>
<body>
<!-- 登录body -->
<form id="form"  method="post" action="ServletLogin">
<div class="logDiv">
    <img class="logBanner" src="static/login/img/logBanner.png"/>
    <div class="logGet">
        <!-- 头部提示信息 -->
        <div class="logD logDtip">
            <p class="p1">登录</p>
        </div>
        <!-- 输入框 -->
        <div class="lgD">
            <img class="img1" src="static/login/img/logName.png"/><input  id="username" name="username" type="text"
                                                                         placeholder="输入管理员用户名"/>
        </div>
        <div class="lgD">
            <img class="img1" src="static/login/img/logPwd.png"/><input id="password" name="password" type="password"
                                                                        placeholder="输入管理员用户密码"/>
        </div>
        <div class="lgD">
           <input id="validcode" style="width: 150px" name="validcode" type="text"
                                                                        placeholder="验证码"/>
            <img src="ServletValidCode" onclick="this.src='ServletValidCode?r='+Math.random()">
        </div>
<%--        <div class="lgD">--%>
<%--            <img class="img1" src="static/login/img/logPwd.png"/><input type="text"--%>
<%--                                                                        placeholder="输入验证码"/>--%>
<%--        </div>--%>
        <div class="logC">
<%--            <a href="index.jsp" target="_self">--%>

     <button id="bn" type="button"> 登 录</button>

<%--                <button>注 册</button>--%>

<%--            </a>--%>


        </div>
    </div>
</div>
</form>
<!-- 登录body  end -->

<!-- 登录页面底部 -->
<div class="logFoot">
    <p class="p1">版权所有：重庆公司公司</p>
    <p class="p2">7788789</p>
</div>
<!-- 登录页面底部end -->
</body>
</html>
